package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.domain.model.ProductUpdateStatus;
import com.ruoyi.system.domain.Technicians;
import com.ruoyi.system.mapper.TechniciansMapper;
import com.ruoyi.system.service.ITechniciansService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TechniciansServicImpl implements ITechniciansService {

    @Autowired
    private TechniciansMapper techniciansMapper;

    @Override
    public List<Technicians> selectList(Technicians technicians) {
        return techniciansMapper.selectList(technicians);
    }

    @Override
    public int batchUpdateStatus(ProductUpdateStatus productUpdateStatus) {
        return techniciansMapper.batchUpdateStatus(productUpdateStatus.getIds(), productUpdateStatus.getStatus());
    }

    @Override
    public void deleteTechnicianByIds(Long[] ids) {
        for (Long id : ids) {
            techniciansMapper.deleteById(id);
        }
    }

    @Override
    public List<Technicians> selectPageList(Technicians technicians) {
        return techniciansMapper.selectPageList(technicians);
    }

    @Override
    public Technicians selectById(Long id) {
        return techniciansMapper.selectById(id);
    }

    @Override
    public int insertTechnicians(Technicians technicians) {
        return techniciansMapper.insertTechnicians(technicians);
    }

    @Override
    public int updateTechnicians(Technicians technician) {
        return techniciansMapper.updateTechnicians(technician);
    }

    @Override
    public int updateStatus(Technicians technicians) {
        return techniciansMapper.updateStatus(technicians);
    }

}
